package xml枚举.作业.student;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class 运行 {
    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        Class clazz = xiaoming.class;

        Constructor constructor = clazz.getDeclaredConstructor();
        //获取构造方法 无参
        constructor.setAccessible(true);
        //临时批注

        Object o = constructor.newInstance();
        //写,给o

        Method[] methods = clazz.getDeclaredMethods();
        //获取所有成员方法
        for (Method method : methods) {
            if(method.isAnnotationPresent(test.class)){
                //判断方法上有没有test注解
                System.out.println(o);
            }
        }
    }
}
